public class ThreeNumbers {

  public static void main(String[] args) {
    for (int i = 100; 3 * i < 1000; i++) {
      if (figure(i))
        System.out.printf("%d %d %d\n", i, i * 2, i * 3);
    }
  }

  private static boolean figure(int number) {
    int[] digits = new int[10];
    for (int digit : digits) {
      digit = 0;
    }

    for (int i = 1; i <= 3; i++) {
      digits[number * i % 10] = 1;
      digits[number * i / 10 % 10] = 1;
      digits[number * i / 100] = 1;

    }

    for (int j = 1; j < digits.length; j++) {
      if (digits[j] != 1)
        return false;
    }

    return true;
  }
}
